package com.longma.server.constant.enums;

/**
 * 镜像方向
 */
public enum PTZMirrorEnum implements IBaseEnum<Integer>{
    //上下
    TOP_BOTTOM(0,"上下"),

    //左右
    LEFT_RIGHT(1,"左右"),

    // 中心
    CENTER(2,"中心");

    /**
     * 值
     */
    private int value;

    /*
     * 描述信息
     */
    private String desc;

    /**
     * 构造函数
     */
    PTZMirrorEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    /**
     * 通过值转为枚举类型
     */
    public static PTZMirrorEnum fromValue(int value) {
        switch (value) {
            case 0:
                return TOP_BOTTOM;
            case 1:
                return LEFT_RIGHT;
            case 2:
                return CENTER;
            default:
                throw new IllegalArgumentException();
        }
    }

    /**
     * 获取值
     */
    @Override
    public Integer getValue() {
        return this.value;
    }

    @Override
    public String getDesc() {
        return  this.desc;
    }
}
